/*              Copyright(c) 2008 Dave Sexton              *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.Design;

namespace DaveSexton.Sandcastle
{
	public abstract partial class ResolveExternalLinksComponentHost
	{
		/// <summary>
		/// Gets the directory where files are commonly stored that contain project settings.
		/// </summary>
		public abstract string SettingsDirectory { get; }

		/// <summary>
		/// Gets the current directory for the environemnt that can be used to base relative paths.
		/// </summary>
		public abstract string CurrentDirectory { get; }

		/// <summary>
		/// Gets an <see cref="ApiReferenceCollection"/> that contains the identifiers of the topics
		/// that are currently built by the project.
		/// </summary>
		internal abstract ApiReferenceCollection ApiReferences { get; }

		/// <summary>
		/// Includes the specified <paramref name="file"/> as a project item.
		/// </summary>
		/// <param name="file">Full or relative file path to be included as a project item.</param>
		public abstract void IncludeItemInProject(string file);

		/// <summary>
		/// Checks out the specified <paramref name="file"/> from source control.
		/// </summary>
		/// <param name="file">Full or relative file path to be checked out.</param>
		public abstract void CheckoutItemInProject(string file);

		/// <summary>
		/// Gets an implementation of <see cref="ResolveExternalLinksComponentHost"/> that provides type-safe access to specialized host services.
		/// </summary>
		/// <param name="provider"><see cref="IServiceProvider"/> implementation that's used to communicate with the host.</param>
		/// <returns>Implementation of <see cref="ResolveExternalLinksComponentHost"/> that provides access to the component's host.</returns>
		public static ResolveExternalLinksComponentHost GetHost(IServiceProvider provider)
		{
			if (provider == null)
				// The provider argument will be null during help builds and when the host is unavailable.
				return null;
			else
				return ResolveExternalLinksComponentDocProjectHost.GetDocProjectHost(provider);

			// Try other host types if GetDocProjectHost returns null
		}
	}
}
